#include "GLView.h"

GLView::GLView(){
    makeCurrent();
    glewInit();
    context =   new GLContext();
    context->LoadProgram("basic", "../../Resources/basique.frag", "../../Resources/basique_2D.vert");
    enti    =   new Entity();
    enti->m_Mesh = Mesh::NewRect(1,1);


}


void GLView::initializeGL(){

    glClearColor(0.7, 0.7, 0.7, 0.0);
    glEnable(GL_DEPTH_TEST);
}

void GLView::paintGL(){
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    enti->Display();
}

void GLView::resizeGL(int w, int h){
    glViewport(0, 0, w, h);
}
